package com.zhangzhan.gulimallorder.config;

import com.zhangzhan.gulimallorder.interceptor.OrderInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 张一恒
 * @version 1.0
 * @description:
 * @date 2024/6/29 4:18
 */
@Configuration
public class OrderWebMvnConfig implements WebMvcConfigurer {

    @Autowired
    private OrderInterceptor orderInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(orderInterceptor).addPathPatterns("/**");
    }
}
